package Datastruct.Kruskal.prim;

//普雷姆算法
public class primAlgorithm {
    public static void main(String[] args) {
        char[] data = {'A', 'B', 'C', 'D', 'E', 'F', 'G'};
        int verxs = data.length;
        int[][] weight = {
                {10000, 5, 7, 10000, 10000, 10000, 2},
                {5, 10000, 10000, 9, 10000, 10000, 3},
                {7, 10000, 10000, 10000, 8, 10000, 10000},
                {10000, 9, 10000, 10000, 10000, 4, 10000},
                {10000, 10000, 8, 10000, 10000, 5, 4},
                {10000, 10000, 10000, 4, 5, 10000, 6},
                {2, 3, 10000, 10000, 4, 6, 10000},

        };
        MGraph mGraph = new MGraph(verxs);
        Mintree mintree = new Mintree();
        mintree.crateGraph(mGraph, verxs, data, weight);
        mintree.showGraph(mGraph);
        mintree.prim(mGraph, 0);
    }


}
